package com.je.app.view.popUp;

import javax.swing.JDialog;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;

import com.je.app.control.ControlSesion;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Component;
import java.awt.SystemColor;

import javax.swing.SwingConstants;
import javax.swing.JSeparator;
import java.awt.Font;
import java.awt.Insets;
import java.awt.Color;

public class ProntoFinTurno extends JDialog{
	private JTextField userField;
	private JTextField txtUsuario;
	private JTextField txtContrasea;
	private JTextField txtHabitacin;
	private JTextField textField_1;
	private JTextField txtTiempoRestante;
	private JTextField textField;
	private JTextField textField_2;
	private JTextField txtProntoFinalizarUn;
	private JSeparator separator;
	private JSeparator separator_1;
	private JSeparator separator_2;
	private JSeparator separator_3;


	public ProntoFinTurno(final String nombreHab, String horaInicio, String horaFin, String tiempoRestante){
		setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);

		getContentPane().setLayout(null);
		
		setSize(358,339);
		setResizable(false);
		setLocationRelativeTo(null);
		
		userField = new JTextField(horaInicio);
		userField.setHorizontalAlignment(SwingConstants.CENTER);
		userField.setEditable(false);
		userField.setBounds(193, 108, 86, 21);
		getContentPane().add(userField);
		userField.setColumns(10);
		
		txtUsuario = new JTextField();
		txtUsuario.setHorizontalAlignment(SwingConstants.RIGHT);
		txtUsuario.setText("Hora inicio:");
		txtUsuario.setBorder(null);
		txtUsuario.setEditable(false);
		txtUsuario.setColumns(10);
		txtUsuario.setBounds(112, 104, 55, 29);
		getContentPane().add(txtUsuario);
		
		txtContrasea = new JTextField();
		txtContrasea.setHorizontalAlignment(SwingConstants.RIGHT);
		txtContrasea.setText("Hora fin:");
		txtContrasea.setBorder(null);
		txtContrasea.setEditable(false);
		txtContrasea.setColumns(10);
		txtContrasea.setBounds(124, 144, 43, 29);
		getContentPane().add(txtContrasea);
		
		JButton buttonIngresar = new JButton("Posponer");
		buttonIngresar.setBackground(SystemColor.activeCaptionBorder);
		buttonIngresar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				new PosponerFinalizacion(nombreHab);
				dispose();
			}
		});
		buttonIngresar.setBounds(184, 236, 95, 26);
		getContentPane().add(buttonIngresar);
		
		JButton btnAceptar = new JButton("Aceptar");
		btnAceptar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				dispose();
			}
		});
		btnAceptar.setBackground(SystemColor.activeCaptionBorder);
		btnAceptar.setBounds(63, 235, 95, 27);
		getContentPane().add(btnAceptar);
		
		txtHabitacin = new JTextField();
		txtHabitacin.setHorizontalAlignment(SwingConstants.RIGHT);
		txtHabitacin.setFont(new Font("Tahoma", Font.BOLD, 12));
		txtHabitacin.setText("Habitaci\u00F3n:");
		txtHabitacin.setEditable(false);
		txtHabitacin.setColumns(10);
		txtHabitacin.setBorder(null);
		txtHabitacin.setBounds(94, 68, 73, 29);
		getContentPane().add(txtHabitacin);
		
		textField_1 = new JTextField(nombreHab);
		textField_1.setFont(new Font("Tahoma", Font.BOLD, 12));
		textField_1.setHorizontalAlignment(SwingConstants.CENTER);
		textField_1.setEditable(false);
		textField_1.setColumns(10);
		textField_1.setBounds(193, 72, 86, 21);
		getContentPane().add(textField_1);
		
		txtTiempoRestante = new JTextField();
		txtTiempoRestante.setHorizontalAlignment(SwingConstants.RIGHT);
		txtTiempoRestante.setText("Tiempo restante:");
		txtTiempoRestante.setEditable(false);
		txtTiempoRestante.setColumns(10);
		txtTiempoRestante.setBorder(null);
		txtTiempoRestante.setBounds(83, 184, 84, 29);
		getContentPane().add(txtTiempoRestante);
		
		textField = new JTextField(horaFin);
		textField.setHorizontalAlignment(SwingConstants.CENTER);
		textField.setEditable(false);
		textField.setColumns(10);
		textField.setBounds(193, 148, 86, 21);
		getContentPane().add(textField);
		
		textField_2 = new JTextField(tiempoRestante);
		textField_2.setHorizontalAlignment(SwingConstants.CENTER);
		textField_2.setEditable(false);
		textField_2.setColumns(10);
		textField_2.setBounds(193, 188, 86, 21);
		getContentPane().add(textField_2);
		
		txtProntoFinalizarUn = new JTextField();
		txtProntoFinalizarUn.setText("Pronto finalizar\u00E1 un turno");
		txtProntoFinalizarUn.setMargin(new Insets(2, 14, 2, 2));
		txtProntoFinalizarUn.setHorizontalAlignment(SwingConstants.CENTER);
		txtProntoFinalizarUn.setFont(new Font("Tahoma", Font.PLAIN, 16));
		txtProntoFinalizarUn.setEditable(false);
		txtProntoFinalizarUn.setColumns(10);
		txtProntoFinalizarUn.setBorder(null);
		txtProntoFinalizarUn.setBounds(32, 25, 197, 20);
		getContentPane().add(txtProntoFinalizarUn);
		
		separator = new JSeparator();
		separator.setBounds(22, 35, 305, 1);
		getContentPane().add(separator);
		
		separator_1 = new JSeparator();
		separator_1.setOrientation(SwingConstants.VERTICAL);
		separator_1.setForeground(Color.LIGHT_GRAY);
		separator_1.setBounds(22, 35, 1, 252);
		getContentPane().add(separator_1);
		
		separator_2 = new JSeparator();
		separator_2.setOrientation(SwingConstants.VERTICAL);
		separator_2.setForeground(Color.LIGHT_GRAY);
		separator_2.setBounds(326, 35, 1, 252);
		getContentPane().add(separator_2);
		
		separator_3 = new JSeparator();
		separator_3.setBounds(22, 286, 305, 1);
		getContentPane().add(separator_3);
		setTitle("Un turno est\u00E1 por finalizar");
		setVisible(true);
	}
}
